/*  1:   */ package org.jetbrains.debugger.frame;
/*  2:   */ 
/*  3:   */

import com.intellij.icons.AllIcons.Debugger;
import com.intellij.ui.ColoredTextContainer;
import com.intellij.ui.SimpleTextAttributes;
import com.intellij.xdebugger.XSourcePosition;
import com.intellij.xdebugger.evaluation.XDebuggerEvaluator;
import com.intellij.xdebugger.frame.XStackFrame;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import org.jetbrains.debugger.SourceInfo;

/*  4:   */
/*  5:   */
/*  6:   */
/*  7:   */
/*  8:   */
/*  9:   */
/* 10:   */
/* 11:   */
/* 12:   */
/* 13:   */ 
/* 14:   */ public abstract class StackFrameImplBase
/* 15:   */   extends XStackFrame
/* 16:   */ {
/* 17:   */   protected final SourceInfo sourceInfo;
/* 18:   */   protected XDebuggerEvaluator evaluator;
/* 19:   */   
/* 20:   */   public StackFrameImplBase(@Nullable SourceInfo paramSourceInfo)
/* 21:   */   {
/* 22:19 */     this.sourceInfo = paramSourceInfo;
/* 23:   */   }
/* 24:   */   
/* 25:   */   public final XDebuggerEvaluator getEvaluator()
/* 26:   */   {
/* 27:24 */     if (this.evaluator == null) {
/* 28:25 */       this.evaluator = createEvaluator();
/* 29:   */     }
/* 30:27 */     return this.evaluator;
/* 31:   */   }
/* 32:   */   
/* 33:   */   protected abstract XDebuggerEvaluator createEvaluator();
/* 34:   */   
/* 35:   */   public XSourcePosition getSourcePosition()
/* 36:   */   {
/* 37:34 */     return this.sourceInfo;
/* 38:   */   }
/* 39:   */   
/* 40:   */   protected boolean isInFileScope()
/* 41:   */   {
/* 42:38 */     return false;
/* 43:   */   }
/* 44:   */   
/* 45:   */   public final void customizePresentation(@NotNull ColoredTextContainer paramColoredTextContainer)
/* 46:   */   {
/* 47:43 */     if (paramColoredTextContainer == null) {
/* 48:43 */       throw new IllegalArgumentException(String.format("Argument %s for @NotNull parameter of %s.%s must not be null", new Object[] { "0", "org/jetbrains/debugger/frame/StackFrameImplBase", "customizePresentation" }));
/* 49:   */     }
/* 50:43 */     if (this.sourceInfo == null)
/* 51:   */     {
/* 52:44 */       customizeInvalidFramePresentation(paramColoredTextContainer);
/* 53:45 */       return;
/* 54:   */     }
/* 55:48 */     String str1 = this.sourceInfo.getFile().getName();
/* 56:49 */     int i = this.sourceInfo.getLine() + 1;
/* 57:   */     
/* 58:51 */     String str2 = this.sourceInfo.getFunctionName();
/* 59:52 */     if ((str2 == null) || ((str2.isEmpty()) && (isInFileScope())))
/* 60:   */     {
/* 61:53 */       paramColoredTextContainer.append(str1 + ":" + i, SimpleTextAttributes.REGULAR_ATTRIBUTES);
/* 62:   */     }
/* 63:   */     else
/* 64:   */     {
/* 65:56 */       if (str2.isEmpty()) {
/* 66:57 */         paramColoredTextContainer.append("anonymous", SimpleTextAttributes.REGULAR_ITALIC_ATTRIBUTES);
/* 67:   */       } else {
/* 68:60 */         paramColoredTextContainer.append(str2, SimpleTextAttributes.REGULAR_ATTRIBUTES);
/* 69:   */       }
/* 70:62 */       paramColoredTextContainer.append("(), " + str1 + ":" + i, SimpleTextAttributes.REGULAR_ATTRIBUTES);
/* 71:   */     }
/* 72:64 */     paramColoredTextContainer.setIcon(AllIcons.Debugger.StackFrame);
/* 73:   */   }
/* 74:   */   
/* 75:   */   protected void customizeInvalidFramePresentation(ColoredTextContainer paramColoredTextContainer)
/* 76:   */   {
/* 77:68 */     super.customizePresentation(paramColoredTextContainer);
/* 78:   */   }
/* 79:   */ }



/* Location:           E:\idea\

 * Qualified Name:     org.jetbrains.debugger.frame.StackFrameImplBase

 * JD-Core Version:    0.7.0.1

 */